package ua.ck.example.domain;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.DateTimeFormat;

@Entity
@Table(name = "employees")
public class Employee implements java.io.Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -6501172235628201480L;
	@Id
	@GeneratedValue
	private Integer empId;
	@Size(min = 3, max = 30)
	private String empName;
	@NotNull
	@NotEmpty
	private String password;
	
	private Timestamp hireDate;

	private int mgrId;

	private double sal;
	private double commonRate;
	@OneToMany(fetch=FetchType.EAGER, mappedBy = "employee")
	private Set<Order> orders = new HashSet<Order>(0);

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Set<Order> getOrders() {
		return orders;
	}

	public void setOrders(Set<Order> orders) {
		this.orders = orders;
	}

	public Integer getEmpId() {
		return empId;
	}

	public void setEmpId(Integer empId) {
		this.empId = empId;
	}

	public String getEmpName() {
		return empName;
	}

	public void setEmpName(String empName) {
		this.empName = empName;
	}

	public Timestamp getHireDate() {
		return hireDate;
	}

	public void setHireDate(Timestamp hireDate) {
		this.hireDate = hireDate;
	}

	public int getMgrId() {
		return mgrId;
	}

	public void setMgrId(int mgrId) {
		this.mgrId = mgrId;
	}

	public double getSal() {
		return sal;
	}

	public void setSal(double sal) {
		this.sal = sal;
	}

	public double getCommonRate() {
		return commonRate;
	}

	public void setCommonRate(double commonRate) {
		this.commonRate = commonRate;
	}

}
